/*
 *  Copyright (c) 2017 The PANSHI Studio authors. All Rights Reserved.
 *
 *  Use of this source code is governed by a BSD-style license
 *  that can be found in the LICENSE file in the root of the source
 *  tree. An additional intellectual property rights grant can be found
 *  in the file PATENTS.  All contributing project authors may
 *  be found in the AUTHORS file in the root of the source tree.
 */


#ifndef SA_VOE_WRAPPER_H
#define SA_VOE_WRAPPER_H

#include <string>
#include "common/sa_common_define.h"
#include "common/sa_common_types.h"

NS_SA_BEGIN

class SA_DLLEXPORT SaVoeWrapper {
  public:
	static SaVoeWrapper* GetInstance();
	static bool Destory();
    // Returns -1 in case of an error, 0 otherwise.
    virtual int Init() = 0;
	
    // Device enumeration
    virtual int PlayoutDevicesNum() = 0;
    virtual int RecordingDevicesNum() = 0;
    virtual int PlayoutDeviceName(int index, std::string& strName) = 0;
    virtual int RecordingDeviceName(int index, std::string& strName) = 0;

    // Device selection
    virtual int SetPlayoutDevice(int index) = 0;
    virtual int SetRecordingDevice(int index) = 0;

    // Supported play format enumeration
    virtual int SupportPlayLocalFileFormatNum() = 0;
    virtual int SupportPlayLocalFileFormatDisp(int index, std::string& strDisp) = 0;
    virtual int SetPlayLocalFileFormat(int index) = 0;
    // Supported record codecinst enumeration
    virtual int SupportRecordLocalFileCodecInstNum() = 0;
    virtual int SupportRecordLocalFileCodecInstDisp(int index, std::string& strDisp) = 0;
    virtual int SetRecordLocalFileCodecInst(int index) = 0;

    // Local file play or record
    virtual int StartPlayingFileLocally(const std::string& strFileName) = 0;
    virtual int StopPlayingFileLocally() = 0;
    virtual int StartRecordingMicrophone(const std::string& strFileName) = 0;
    virtual int StopRecordingMicrophone() = 0;

  	// Terminates all VoiceEngine functions and releases allocated resources.
  	// Returns 0.
  	virtual int Terminate() = 0;

 protected:
  	SaVoeWrapper(){}
    virtual ~SaVoeWrapper(){}
};

NS_SA_END

#endif  // SA_VOE_WRAPPER_H

